查照jenkins 版本
1 | docker search jenkins |
创建jenkins 的挂载目录
1 | mkdir /mydata/jenkins |
给jenkins挂载目录赋权
1 | chown -R 1000:1000 /mydata/jenkins |
touch: cannot touch ‘/var/jenkins_home/copy_reference_file.log’: Permission denied
Can not write to /var/jenkins_home/copy_reference_file.log. Wrong volume permissions?
1 | #### jenkins启动 |
docker run –name jenkins -p 9997:8080 -v /mydata/jenkins:/var/jenkins_home -d jenkins:2.60.3
1 |
|
dockers stop jenkins
1 | #### 修改默认的插件下载地址 进入“{你的Jenkins工作目录}/updates/”目录下修改“default.json” |
sed -i ‘s#http://updates.jenkins-ci.org/download#https://mirrors.tuna.tsinghua.edu.cn/jenkins#g' default.json && sed -i ‘s#http://www.google.com#https://www.baidu.com#g' default.json
1 | #### 然后启动jenkins |
dockers start jenkins
1 | #### 远程登录之后需要输入用户密码在 |
/var/jenkins_home/secrets/initialAdminPassword
1 | #### 挂载之后在 |
/mydata/jenkins/secrets/initialAdminPassword
```